﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TestOtherService
{
    public partial class FrmTrain : Form
    {
        public FrmTrain()
        {
            InitializeComponent();
        }

        //创建Web服务类对象
        MyTrainService.TrainTimeWebServiceSoapClient client = new MyTrainService.TrainTimeWebServiceSoapClient();

        private void btnQuery_Click(object sender, EventArgs e)
        {
            //使用服务类对象和本地对象一样
             DataSet ds = client.getStationAndTimeByStationName(this.txtStartStation.Text.Trim(),this.txtEndStation.Text.Trim(),"");

            //显示数据
            this.dgvList.DataSource = ds.Tables[0];
        }
    }
}
